<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title><#if topic??>编辑<#else>发布</#if>主题 - 熊猫知识库</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="<#if topic??>编辑<#else>发布</#if>主题 - 甜甜圈,知识库,问答系统">
  <meta name="description" content="<#if topic??>编辑<#else>发布</#if>主题 - 甜甜圈,知识库,问答系统">
  <#include "/common/header.html">

<div class="main layui-clear">
  <div class="fly-panel" pad20>
    <h2 class="page-title"><#if topic??>编辑<#else>发布</#if>主题</h2>

    <div class="layui-form layui-form-pane">
      <form method="post" action="/topic/save">
        <div class="layui-form-item">
          <label for="title" class="layui-form-label">标题</label>
          <div class="layui-input-block">
            <input type="hidden" id="id" name="id" value="${(topic.id)!""}">
            <input type="text" id="title" name="title" value="${(topic.title)!""}" required lay-verify="required" autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-form-item layui-form-text">
          <div class="layui-input-block">
            <textarea id="content" name="content"  required lay-verify="required" placeholder="请输入内容" class="layui-textarea fly-editor" style="height: 260px;">${(topic.content)!""}</textarea>
          </div>
        </div>
        <div class="layui-form-item">
          <div class="layui-inline">
            <label class="layui-form-label">分类</label>
            <div class="layui-input-block">
	            <input type="hidden" id="categoryName" name="categoryName"  value="${(topic.categoryName)!""}">
	            <input type="hidden" id="dirType" name="dirType"  value="2">
              <select lay-verify="required" id="categoryId" name="categoryId">
                <option value="1"  <#if categoryId?? && categoryId==1>selected</#if>>问答</option> 
                <option value="2"  <#if categoryId?? && categoryId==2>selected</#if>>知识</option> 
                <option value="3"  <#if categoryId?? && categoryId==3>selected</#if>>词条</option> 
              </select>
            </div>
          </div>
        </div>
        <div class="layui-form-item">
          <button class="layui-btn" lay-filter="*" lay-submit>立即发布</button>
        </div>
      </form>
    </div>
  </div>
</div>

<#assign jsFilename="add">
<#include "/common/footer.html">
</body>
</html>